﻿using System;

namespace OrderControl {
    class Customer {
        private string name;
        private string info;

        public string Name {
            get => name;
            set {
                if(value != null)
                if (value != null && value.Length > 0) {
                    name = value;
                }
                else {
                    throw new OrderPropertyException("Customer name cannot be empty.");
                }
            }
        }
        public string Info { get => info; set => info = value; }

        public Customer(String name, String info) {
            Name = name;
            Info = info;
        }
        public Customer(String name) : this(name, "Null") { }
        public override string ToString() {
            return "[Customer] Name: " + Name
                + ", Info: " + Info;
        }
    }
}
